home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / threads_md.h < prev    next >
C/C++ Source or Header  |  1998-09-15  |  2KB  |  67 lines

  1. /*
  2.  * @(#)threads_md.h    1.26 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. /*
  16.  * Win32 implementation of Java threads
  17.  */
  18.  
  19. #ifndef _WIN32_THREADS_MD_H_
  20. #define _WIN32_THREADS_MD_H_
  21.  
  22. #include <windows.h>
  23. #include "bool.h"
  24. #include "sysmacros_md.h"
  25.  
  26. #define N_TRACED_REGS 7
  27.  
  28. #define SYS_THREAD_NULL         ((sys_thread_t *) 0)
  29.  
  30. /*
  31.  * Machine dependent info in a sys_thread_t: Keep these values in
  32.  * sync with the string array used by sysThreadDumpInfo() in threads_md.c!
  33.  */
  34. typedef enum {
  35.     FIRST_THREAD_STATE,
  36.     RUNNABLE = FIRST_THREAD_STATE,
  37.     SUSPENDED,
  38.     MONITOR_WAIT,
  39.     CONDVAR_WAIT,
  40.     MONITOR_SUSPENDED,
  41.     NUM_THREAD_STATES
  42. } thread_state_t;
  43.  
  44. /*
  45.  * Machine dependent thread data structure
  46.  */
  47. typedef struct sys_thread {
  48.     void *cookie;            /* Back-pointer to shared thread struct */
  49.     HANDLE handle;            /* Win32 thread handle */
  50.     unsigned long id;           /* Win32 thread id */
  51.     void *stack_base;           /* Thread stack base */
  52.     thread_state_t state;        /* Current thread state */
  53.     bool_t system_thread;        /* TRUE if this is a system thread */
  54.     HANDLE interrupt_event;        /* Event signaled on thread interrupt */
  55.     bool_t interrupted;            /* Shadow thread interruption */
  56.     bool_t vmsuspended;            /* This thread is suspended */
  57.     void *(*start_proc)(void *);    /* Thread start routine address */
  58.     void *start_parm;            /* Thread start routine parameter */
  59.     struct sys_thread *next;        /* Next thread in active thread queue */
  60.     unsigned int cacheKey;          /* Key for monitor being looked up */
  61.     void * monitorCache[SYS_TLS_MONCACHE]; /* cache of recently monitors */
  62. } sys_thread_t;
  63.  
  64. extern bool_t ThreadsInitialized;
  65.  
  66. #endif /* !_WIN32_THREADS_MD_H_ */
  67.